<?php

use function Hyperf\Support\env;

return [
    /** 公众平台 */
    'wechat' => [
        'app_id' => env('WECHAT_APP_ID'),
        'secret' => env('WECHAT_SECRET'),
        'token' => env('WECHAT_TOKEN'),
        'aes_key' => env('WECHAT_AES_KEY', ''), // 明文模式请勿填写 EncodingAESKey

        /**
         * OAuth 配置
         *
         * scopes：公众平台（snsapi_userinfo / snsapi_base），开放平台：snsapi_login
         * callback：OAuth授权完成后的回调页地址
         */
        'oauth' => [
            'scopes'   => ['snsapi_userinfo'],
            'callback' => '/shop/v1/oauth'
        ],

        /**
         * 接口请求相关配置，超时时间等，具体可用参数请参考：
         * https://github.com/symfony/symfony/blob/5.3/src/Symfony/Contracts/HttpClient/HttpClientInterface.php
         */
        'http' => [
            'timeout' => 5.0,

            'retry' => true
        ]
    ],
    /** 开放平台-网站应用 */
    'open' => [
        'app_id' => env('WECHAT_OPEN_APP_ID'),
        'secret' => env('WECHAT_OPEN_SECRET'),
        'token' => env('WECHAT_OPEN_TOKEN'),
        'aes_key' => env('WECHAT_OPEN_AES_KEY', ''), // 明文模式请勿填写 EncodingAESKey

        /**
         * 接口请求相关配置，超时时间等，具体可用参数请参考：
         * https://github.com/symfony/symfony/blob/5.3/src/Symfony/Contracts/HttpClient/HttpClientInterface.php
         */
        'http' => [
            'throw'  => true, // 状态码非 200、300 时是否抛出异常，默认为开启
            'timeout' => 5.0,

            'retry' => true
        ]
    ],
    /** 开放平台-第三方平台 */
    'open_third' => [
        'app_id' => env('WECHAT_OPEN_THIRD_APP_ID'),
        'secret' => env('WECHAT_OPEN_THIRD_SECRET'),
        'token' => env('WECHAT_OPEN_THIRD_TOKEN'),
        'aes_key' => env('WECHAT_OPEN_THIRD_AES_KEY', ''), // 明文模式请勿填写 EncodingAESKey

        /**
         * 接口请求相关配置，超时时间等，具体可用参数请参考：
         * https://github.com/symfony/symfony/blob/5.3/src/Symfony/Contracts/HttpClient/HttpClientInterface.php
         */
        'http' => [
            'throw'  => true, // 状态码非 200、300 时是否抛出异常，默认为开启
            'timeout' => 5.0,

            'retry' => true
        ]
    ],
    /** 小程序 */
    'mini' => [
        /**
         * 账号基本信息，请从微信公众平台/开放平台获取
         */
        'app_id'  => env('WECHAT_MINI_APP_ID'),         // AppID
        'secret'  => env('WECHAT_MINI_APP_SCRIPT'),     // AppSecret
        'token'   => env('WECHAT_MINI_TOKEN'),          // Token
        'aes_key' => env('WECHAT_MINI_AES_KEY'),                    // EncodingAESKey，兼容与安全模式下请一定要填写！！！

        /**
         * 接口请求相关配置，超时时间等，具体可用参数请参考：
         * https://github.com/symfony/symfony/blob/5.3/src/Symfony/Contracts/HttpClient/HttpClientInterface.php
         */
        'http' => [
            'throw'  => true, // 状态码非 200、300 时是否抛出异常，默认为开启
            'timeout' => 5.0,

            'retry' => true, // 使用默认重试配置
        ]
    ],

    /** 衫德 */
    'sandpay' => [
        'domain' => 'http://pay.youngbuy.com/sandpay/'
    ],

    /** SafePay */
    'safepay' => [
        'domain' => 'http://pay.youngbuy.com',
        'prefix' => '/safepay/'
    ],

    /** 万里牛ERP */
    'erp' => [
        'api' => [
            'url' => 'https://open-api.hupun.com/api/',
            'app_key' => '3923512014',
            'app_secret' => '3f2d99857138752ca736ed42eaeb58e3',
        ],
        'b2c' => [
            'url' => 'https://erp-open.hupun.com/api/',
            'app_key' => '22U3SY9',
            'app_secret' => 'DE0E37F89E0D3C079E94A56E60A333F4',
        ],
        'edition' => 'v1'
    ],

    /** 阿里云 */
    'alicloud' => [
        /** 物流接口 */
        'logistics' => [
            'domain' => 'https://wuliu.market.alicloudapi.com',
            'app_code' => 'e82f1b3d9a774ac7ab89715440dcd6e7',
            'app_key' => '203806336',
            'app_secret' => 'ahgwih1daldr9o1nkm2jkomvanjszxpx'
        ]
    ],

    /** 创蓝云 */
    'chuanglan' => [
        'id_card_auth' => [
            'app_id' => 'kk4plpT4',
            'app_key' => 'a8ijLX6b',
            'url' => 'https://api.253.com/open/idcard/id-card-auth/vs'
        ],
        'message' => [
            ''
        ]
    ],

    // 推单工具接口
    'push_order' => [
        'url' => 'http://push.youngbuy.com/'
    ],
];